import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import reportWebVitals from './reportWebVitals';

// 引入UI框架
import * as Vant from 'react-vant'

// 引入UI框架的图标库
import * as Icon from '@react-vant/icons'

// 引入路由
import * as Router from 'react-router-dom'

// 引入cookie
import Cookies from 'react-cookies'

// 引入Api
import Api from '@/api/index'

// 定义全局属性
React.$Vant = Vant
React.$Icon = Icon
React.$Router = Router
React.$Cookies = Cookies
React.$Api = Api

// 定义一个全局登录信息属性
React.$LoginUser = React.$Cookies.load('LoginUser',{path:'/'}) ? JSON.parse(React.$Cookies.load('LoginUser',{path:'/'})) : {}

const root = ReactDOM.createRoot(document.getElementById('root'));

root.render(
    // <React.StrictMode>
        <App />
    // </React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
